package core.hxl.listener;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.task.listener.TaskExecutionListener;
import org.springframework.cloud.task.repository.TaskExecution;

public class TaskListener implements TaskExecutionListener {

    private final static Logger logger = LoggerFactory.getLogger(TaskListener.class);

    @Override
    public void onTaskStartup(TaskExecution taskExecution) {
        logger.info("Task Start");
    }

    @Override
    public void onTaskEnd(TaskExecution taskExecution) {
        logger.info("Task END");
    }

    @Override
    public void onTaskFailed(TaskExecution taskExecution, Throwable throwable) {
        logger.info("Task Failed");
    }
}
